package org.swfer.UICExtend 
{
	/**
	 * 单例管理者
	 * @author swfer
	 */
	public class Singleton 
	{
		private static var dict:Object;
		
		public function Singleton() 
		{
		}
		
		private static function getInstance(name:String,def:Class):*
		{
			dict = dict || { };
			dict[name] = dict[name] || new def();
			return dict[name]
		}
		
		public static function deleteInstance(name:String):void
		{
			delete dict[name];
		}
		
		public static function get skinManager():SkinManager
		{
			return getInstance('SkinManager',SkinManager);
		}
		
		public static function get lifeCycleManager():LifeCycleManager
		{
			return getInstance('LifeCycleManager',LifeCycleManager);
		}
		
		public static function get dialogManager():DialogManager
		{
			return getInstance('DialogManager',DialogManager);
		}
		
		public static function get timerManager():TimerManager
		{
			return getInstance('TimerManager',TimerManager);
		}
		
	}

}